Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vdiff subcommands #113

Merged
merged 6 commits into from
Aug 4, 2023
Merged

Add vdiff subcommands #113

merged 6 commits into from
Aug 4, 2023

Conversation

bearfriend
Copy link
Contributor

  • Moves migrate-goldens to d2l-test-runner vdiff migrate
  • Moves d2l-test-vdiff-report to d2l-test-runner vdiff report
  • Moves --golden option to a subcommand d2l-test-runner vdiff golden
  • Adds subcommands to --help output
  • Adds clarifying output before running tests to generate goldens
  • Adds dtr shortcut command

@bearfriend bearfriend requested a review from a team as a code owner August 2, 2023 20:23
Comment on lines 9 to 10
export async function migrate(argv = []) {
const { pattern = './**' } = commandLineArgs({ name: 'pattern', type: String, defaultOption: true }, { partial: true, argv });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only changes to this from the bin version were wrapping it in a function and changing the default pattern from ./test/** to ./** because there's no reason to restrict where to look for goldens by default.

Copy link
Contributor

@svanherk svanherk Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this look in node_modules? I remember that coming up in the old library

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will, but it's being ignored on line 12

Copy link
Member

@dlockhart dlockhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

bin/d2l-test-runner.js Outdated Show resolved Hide resolved
bin/d2l-test-runner.js Outdated Show resolved Hide resolved
@@ -15,8 +15,7 @@
},
"bin": {
"d2l-test-runner": "./bin/d2l-test-runner.js",
"d2l-test-vdiff-report": "./bin/d2l-test-vdiff-report.js",
"migrate-goldens": "./bin/migrate-goldens.js"
"dtr": "./bin/d2l-test-runner.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol not sure I'll be able to use this without reading it as "define the relationship"

src/server/bail.js Outdated Show resolved Hide resolved
import { runner } from '../../src/server/cli/test-runner.js';

const { argv, stdout } = process;
Copy link
Contributor Author

@bearfriend bearfriend Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing process and destructuring allows us to modify argv globally to test different inputs.

@bearfriend bearfriend merged commit 3335b1f into main Aug 4, 2023
1 check passed
@bearfriend bearfriend deleted the dgleckler/subcommands branch August 4, 2023 16:45
@ghost
Copy link

ghost commented Aug 4, 2023

🎉 This PR is included in version 0.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants